Method and network device for distributing multi-protocol label switching labels

ABSTRACT

A method and network device for distributing Multi-Protocol Label Switching (MPLS) labels are provided by the present invention. The method for distributing the MPLS labels includes: a first device receives a Border Gateway Protocol (BGP) protocol message transmitted from a second device, wherein the BGP protocol message carries a service identifier of the second device; the first device establishes, according to the service identifier of the first device and the service identifier of the second device, a corresponding relationship between the first device and the second device; the first device distributes a MPLS label for the corresponding relationship. The present invention realizes that the MPLS labels are distributed for some type of the specific logical relationship between the two nodes in the BGP protocol, so that the network devices running the BGP protocol can efficiently obtain the MPLS label corresponding to the specific logical relationship.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2011/075229, filed on Jun. 2, 2011, which claims priority toChinese Patent Application No. 201010538280.3, filed on Nov. 9, 2010,both of which are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communications, and moreparticularly to a method and a network device for distributing MPLSlabels.

BACKGROUND

MPLS is an abbreviation of Multi-Protocol Label Switching. MPLS makesuse of short labels with fixed length to encapsulate packets, andachieves quick forwarding at a data plane. At a control plane, MPLSpossesses strong and flexible routing functionality of IP network, andcan satisfy requirements of various new applications on the network.

Such technique was initially proposed in order to enhance the forwardingspeed of the router. In comparison with a traditional IP routing mode,in the technique, during forwarding data, only at the network edge is anIP message header analyzed, while the IP message header does not need tobe analyzed at each hop, thus reducing the processing time.

With the development of the ASIC technology, the routing searching speedis no longer a bottleneck blocking development of the network. Thismakes unobvious the advantage of MPLS in terms of enhancing theforwarding speed. However, the characteristics of MPLS in supportingmultilayer labels and connection oriented forwarding plane enable MPLSto be widely applied in such aspects as virtual private network (VPN),traffic engineering and quality of service (QoS), etc.

MPLS performs forwarding on the basis of labels, and assignment as wellas distribution of MPLS labels can be statically configured or achievedvia such protocols as LDP, RSVP-TE and BGP, etc. RSVP-TE is mainly usedto achieve the establishment of TE LSP, LDP can be applied in theestablishment of LSP with topologically driven route or serve as asignaling protocol of the pseudo-wire (PW) label in L2VPN, and theborder gateway protocol (BGP) mainly extends the signaling protocolserving as the private network routing label under VPN and establishesLSP of the label routing under a cross-domain VPN.

Currently, the BGP protocol running on a certain device distributes,only according to a specific service element, such as VPN routing, a VPNinstance, a VPLS instance, etc., the same one MPLS label or the same onegroup of MPLS labels corresponding to the service element to all otherdevices having established BGP protocol neighborhood with the currentdevice.

SUMMARY OF THE INVENTION

It is one objective of the present invention to provide a method and anetwork device for distributing MPLS labels.

The technical solutions of the present invention are as follows.

The present invention discloses a method for distributing multi-protocollabel switching (MPLS) labels, includes receiving, by a first device, aborder gateway protocol, BGP, protocol message transmitted from a seconddevice, wherein the BGP protocol message carries a service identifier ofthe second device, establishing, by the first device, a correspondingrelationship between the first device and the second device, accordingto a service identifier of the first device and the service identifierof the second device, and distributing, by the first device, an MPLSlabel for the corresponding relationship.

The present invention further discloses a network device, characterizedin including a border gateway protocol, BGP, protocol message receivingunit, a corresponding relationship establishing unit, and an MPLS labeldistributing unit, wherein the BGP protocol message receiving unitreceives a BGP protocol message transmitted from another network device,the BGP protocol message carrying a service identifier of the anothernetwork device, the corresponding relationship establishing unitestablishes a corresponding relationship between the network device andthe another network device according to a service identifier of thenetwork device and the service identifier of the another network device,and the label distributing unit distributes an MPLS label for thecorresponding relationship.

The present invention is advantageous as it realizes that the MPLSlabels are distributed for certain specific logical relationship betweentwo nodes in the BGP protocol, so that the network devices running theBGP protocol can efficiently obtain the MPLS label corresponding to thespecific logical relationship.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, and theadvantages thereof, reference is now made to the following descriptionstaken in conjunction with the accompanying drawing, in which:

FIG. 1 is a flowchart illustrating the method according to an embodimentof the present invention;

FIG. 2 is a flowchart illustrating the method according to an embodimentof the present invention;

FIG. 3 is a schematic diagram illustrating the transmission andreception of a message according to an embodiment of the presentinvention;

FIG. 4 is a schematic diagram illustrating the transmission andreception of a message according to an embodiment of the presentinvention;

FIG. 5 is a schematic diagram illustrating the network device accordingto an embodiment of the present invention;

FIG. 6 is a schematic diagram illustrating the network device accordingto an embodiment of the present invention; and

FIG. 7 is a schematic diagram illustrating the network device accordingto an embodiment of the present invention.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The present invention is described in detail below with reference to theaccompanying drawings and specific embodiments. However, as should benoted, the embodiments as hereinafter described are merely exampleslisted to help understand the technical solutions, and are not meant todefine the present invention.

According to an embodiment of the present invention, there is provided amethod for distributing multi-protocol label switching (MPLS) labels fora network device, which method is applied in a network system thatincludes a first device and a second device, as shown in FIG. 1.

In Step 11, a first device receives a border gateway protocol (BGP)protocol message transmitted from a second device, wherein the BGPprotocol message carries a service identifier of the second device.

In Step 12, the first device establishes, according to a serviceidentifier of the first device and the service identifier of the seconddevice, a corresponding relationship between the first device and thesecond device.

In Step 13, the first device distributes an MPLS label for thecorresponding relationship.

Optionally, the service identifier of a device may include a deviceidentifier of the device, so the service identifier of the first deviceand the service identifier of the second device include the deviceidentifier of the first device and the device identifier of the seconddevice, respectively. The device identifier is an identifier that iscapable of uniquely identifying the device, such as the IP address ofthe device.

When the service identifier of the device include the device identifierof the device, a binary set (device identifier 1, device identifier 2)including two elements, namely the device identifier of the first deviceand the device identifier of the second device, may be used to representthe corresponding relationship between the first device and the seconddevice.

Optionally, the service identifier of a device may also include a logicdomain identifier of the device and the device identifier of the device.The logic domain is a virtual network formed by interconnecting at leasttwo local area networks, hosts, routers or other network devices via thepublic network tunneling technology. Preferably, the logic domainincludes the 3-layer virtual private network (L3VPN) and the 2-layervirtual private network (L2VPN), of which L2VPN includes the virtualprivate LAN service (VPLS) and the virtual private wire service (VPWS).Preferably, the logic domain identifier includes a route target (RT), aroute distinguisher (RD), a virtual private LAN service identifier (VPLSID), an attachment identifier (AI) and/or an attachment circuitidentifier (ACI), etc.

Correspondingly, the service identifier of the first device includes thelogic domain identifier of the first device and the device identifier ofthe first device, and the service identifier of the second deviceincludes the logic domain identifier of the second device and the deviceidentifier of the second device.

When the service identifier of the device include the logic domainidentifier and the device identifier of the device, the first devicedetermines whether the first device and the second device are located inthe same logic domain according to the logic domain identifier of itsown and the logic domain identifier of the second device.

If the first device and the second device are located in the same logicdomain, the first device establishes the corresponding relationshipbetween the first device and the second device.

It is possible to use a binary set including two elements, namely thedevice identifier of the first device and the device identifier of thesecond device, to represent the corresponding relationship between thefirst device and the second device, and it is also possible to use aternary set including three elements, namely the same logic domainidentifier, the device identifier of the first device and the deviceidentifier of the second device, to represent the correspondingrelationship between the first device and the second device.

Preferably, in this embodiment, the BGP protocol message is a BGP UPDATEmessage as defined in RFC4271 of the Internet Engineering Task Force(IETF).

Preferably, in this embodiment, the first device transmits the MPLSlabel to the second device, so that the second device uses the MPLSlabel to communicate with the first device.

After receiving the MPLS label transmitted from the first device, thesecond device uses the MPLS label to transmit a message to the firstdevice, thus realizing communication with the first device.

Preferably, the first device may also transmit the BGP protocol messageto the second device. The BGP protocol message carries the serviceidentifier of the first device. The second device establishes acorresponding relationship between the first device and the seconddevice according to the service identifier of the first device and theservice identifier of the second device. The second device distributesan MPLS label for the corresponding relationship. Preferably, in thisembodiment, the BGP protocol message is a BGP UPDATE message as definedin RFC4271 of the Internet Engineering Task Force (IETF).

The aforementioned method for the second device to distribute labels forthe first device is essentially the same as the method for the firstdevice to distribute labels for the second device in this embodiment.

The MPLS label distributed by the second device and the MPLS labeldistributed by the first device are independent of each other.Preferably, the second device transmits the MPLS label distributedthereby to the first device, and the first device communicates with thesecond device according to the MPLS label distributed by the seconddevice. Thus, it is possible for either of the first device or thesecond device to communicate with the other by using the labeldistributed by the other.

Preferably, the first device and the second device are network devicescapable of executing function of routing or switching, and includeswitches, routers, network devices based on packet switching, ormulti-service access node devices.

Preferably, the network system may further include another networkdevice, such as a third device, capable of executing function of routingor switching. Label distribution is performed between every two of thefirst device, the second device and the another network device capableof executing function of routing or switching, and each of the firstdevice, the second device and the another network device capable ofexecuting function of routing or switching communicate with a correspondparty using the label distributed by the correspond party.

When any one of the first device, the second device and the anothernetwork device capable of executing function of routing or switchingdistributes MPLS labels for the other devices, different labels aredistributed to the other devices.

For instance, when the first device, the second device and the thirddevice distribute labels, the label 1-2 distributed by the first devicefor the second device is different from the label 1-3 distributed forthe third device, thereby avoiding label conflict. By the same token,the label 2-1 distributed by the second device for the first device isdifferent from the label 2-3 distributed for the third device.

In addition, with respect to a plurality of devices distributing MPLSlabels for one another, such as the first device, the second device andthe third device, the label distributed by one device for another deviceis independent of the label distributed by the another device for thedevice.

As shown in FIG. 2, in one embodiment of the present invention, anetwork as shown in FIG. 3 and running L2VPN includes PE1 as a firstdevice, PE2 as a second device, PE3 as a third device, PE4 as a fourthdevice, and a route reflector (RR). This embodiment is described asfollows.

In Step 21, the PE1 receives a BGP protocol message transmitted from thePE2, the BGP protocol message carries a service identifier of the PE2,and the service identifier includes a logic domain ID and a deviceidentifier PE ID of the PE2. In this embodiment, the logic domain ID ofthe PE1 is a route target (RT) 1, and the logic domain ID of the PE2 isRT2; the PE ID of the PE1 is PE1 ID, the PE ID of the PE2 is PE2 ID, andthe logic domain in which the PE1 locates is an L2VPN, which includesthe virtual private LAN service (VPLS) and the virtual private wireservice (VPWS). Preferably, the PE ID is an IP address of PE; as shownin FIG. 3, the PE1 receives the BGP protocol message transmitted by thePE2 through the RR. Optionally, the logic domain ID may also be a routedistinguisher (RD), a virtual private LAN service identifier (VPLS ID),an attachment identifier (AI) and/or an attachment circuit identifier(ACI), etc. Preferably, in this embodiment, the BGP protocol message isa BGP UPDATE message as defined in RFC4271 of the IETF.

In Step 22, the PE1 determines whether the logic domain ID of the PE2 isthe same as the logic domain ID of the PE1; if yes, it is determinedthat the PE1 and PE2 are located in the same logic domain, namely in thesame L2VPN, and Step 23 is executed.

In Step 24, the PE1 establishes a corresponding relationship between thePE1 and the PE2 according to the same logic domain ID, the PE1 ID andthe PE2 ID. Preferably, the corresponding relationship may berepresented by a ternary set (the same logic domain ID, PE1 ID, PE2 ID).

The PE1 distributes an MPLS label for the corresponding relationshipbetween the PE1 and the PE2. Preferably, the PE1 distributes an MPLSlabel for the ternary set (the same logic domain ID, PE1 ID, PE2 ID).

Preferably, as shown in FIG. 3, after the PE1 has distributed the MPLSlabel, the PE1 transmits the MPLS label to the PE2. The PE1 may transmitthe MPLS label to the RR, and then the RR transmits the MPLS label tothe PE2.

Preferably, after receiving the MPLS label, the PE2 uses the MPLS labelto encapsulate the message, and transmits the message encapsulated withthe MPLS label to the PE1.

Preferably, as shown in FIG. 4, the PE1 correspondingly transmits to thePE2 a BGP protocol message carrying the service identifier of the PE1;the PE2 determines whether the logic domain ID of the PE2 is the same asthe logic domain ID of the PE1; if yes, the PE2 establishes acorresponding relationship between the PE2 and the PE1 according to thesame logic domain ID, the PE1 ID and the PE2 ID; the PE2 distributes anMPLS label for the corresponding relationship between the PE2 and thePE1.

The MPLS label distributed by the PE1 and the label distributed by thePE2 are independent of each other. Thus, each of the PE1 and the PE2receives an MPLS label distributed by the other. Thereafter, the PE1 andthe PE2 respectively use the MPLS label distributed by the other totransmit messages to the other.

By the same token, the PE1 may also distribute labels for the PE3 andthe PE4, and receive labels distributed by the PE3 and the PE4therefore, whereby the PE1 and the PE3 each may use the MPLS labeldistributed by the other to transmit messages, and the PE1 and the PE4each does also.

Further, for any two PEs of the PE1, the PE2, the PE3 and the PE4, oneof the two PE can distribute an MPLS label for the other of the two PEs,and uses the MPLS label distributed by the other to communicate with theother.

One PE distributes different MPLS labels for the other, different PEs.

The MPLS labels distributed by different PEs are independent of oneanother.

Optionally, the network as recited in this embodiment may exclude theRR, in which case a full-link BGP session is established amongst each ofthe PEs. Correspondingly, the PE1 does not receive the BGP protocolmessage through the RR, and also does not transmit labels distributedfor the other devices to the other devices through the RR.

In an embodiment of the present invention, a network running a 3-layervirtual private network (L3VPN) includes the PE1 and the PE2, andpreferably also includes the PE3.

The embodiment according to the present invention is described asfollows.

In Step 21, the PE1 receives a BGP protocol message transmitted from thePE2, the BGP protocol message carries a service identifier of the PE2,and the service identifier includes a logic domain ID and a PE ID of thePE2. In this embodiment, the logic domain IDs are route targets (RTs).Correspondingly, the logic domain ID of the PE1 is RT1, and the logicdomain ID of the PE2 is RT2; the PE ID of the PE1 is PE1 ID, the PE IDof the PE2 is PE2 ID, and the logic domain in which the PE1 locates isan L3VPN. Optionally, the logic domain ID may also be a routedistinguisher (RD), a virtual private LAN service identifier (VPLS ID),an attachment identifier (AI) and/or an attachment circuit identifier(ACI), etc. Preferably, the PE ID is an IP address of the PE or otherinformation capable of uniquely identifying the PE. Preferably, in thisembodiment, the BGP protocol message is a BGP UPDATE message as definedin RFC4271 of the IETF.

In Step 22, The PE1 determines whether the logic domain ID of the PE2 isthe same as the logic domain ID of the PE1; if yes, step 23 is executed,wherein if the logic domain ID of the PE2 is the same as the logicdomain ID of the PE1, this indicates that the PE1 and the PE2 arelocated in the same L3VPN.

In Step 23, The PE1 establishes a corresponding relationship between thePE1 and the PE2 according to the same logic domain ID, the PE1 ID andthe PE2 ID. Preferably, the corresponding relationship may berepresented by a ternary set (the same logic domain ID, PE1 ID, PE2 ID).

In Step 24, the PE1 distributes an MPLS label for the correspondingrelationship between the PE1 and the PE2. Preferably, the PE1distributes an MPLS label for the ternary set (the same logic domain ID,PE1 ID, PE2 ID).

Preferably, after the PE1 has distributed the MPLS label, the PE1transmits the MPLS label to the PE2.

Preferably, after receiving the MPLS label, the PE2 encapsulates themessage by using the MPLS label, and transmits the message encapsulatedwith the MPLS label to the PE1.

Preferably, the PE1 transmits to the PE2 a BGP protocol message carryingthe service identifier of the PE1; the PE2 determines whether the logicdomain ID of the PE2 is the same as the logic domain ID of the PE1; ifyes, the PE2 establishes a corresponding relationship between the PE2and the PE1 according to the same logic domain ID, the PE1 ID and thePE2 ID; the PE2 distributes an MPLS label for the correspondingrelationship.

The MPLS label distributed by the PE1 and the label distributed by thePE2 are independent of each other. Thus, each of the PE1 and the PE2receives an MPLS label distributed by the other. Thereafter, the PE1 andthe PE2 respectively transmit messages to the other by using the MPLSlabels distributed by the other.

An embodiment of the present invention is described as follows.

A network device, together with another network device, possessescapability to execute function of routing or switching, and isspecifically a switch, a router, a multi-service access node or anetwork device based on packet switching, etc.

As shown in FIG. 5, the network device includes a BGP protocol messagereceiving unit, a corresponding relationship establishing unit, and anMPLS label distributing unit.

The BGP protocol message receiving unit receives a BGP protocol messagetransmitted from another network device, which BGP protocol messagecarries a service identifier of the another network device. Preferably,in this embodiment, the BGP protocol message is a BGP UPDATE message asdefined in RFC4271.

Optionally, the service identifier is a device identifier of the anothernetwork device; alternatively, the service identifier is a logic domainidentifier in the BGP protocol message and a device identifier of theanother network device. The logic domain is a virtual network formed byinterconnecting at least two local area networks, hosts, routers orother network devices via public network tunneling. Preferably, thelogic domain includes the 3-layer virtual private network (L3VPN) andthe 2-layer virtual private network (L2VPN), of which L2VPN includes thevirtual private LAN service (VPLS) and the virtual private wire service(VPWS). The logic domain ID includes a route target (RT), a routedistinguisher (RD), a virtual private LAN service identifier (VPLS ID),an attachment identifier (AI) and/or an attachment circuit identifier(ACI), etc. The device identifier of the another network device itselfis a device identifier, such as the IP address of the another networkdevice, capable of uniquely determining the another network device.

The corresponding relationship establishing unit establishes acorresponding relationship between the network device and the anothernetwork device according to a service identifier of the network deviceand the service identifier of the another network device.

The label distributing unit distributes an MPLS label for thecorresponding relationship.

Preferably, the network device further includes an MPLS labeltransmitting unit.

The MPLS label transmitting unit transmits the MPLS label distributed bythe network device to the another network device. After obtaining theMPLS label, the another network device can transmit a message to thenetwork device by the MPLS label.

Optionally, as shown in FIG. 6, the corresponding relationshipestablishing unit includes a device identifier obtaining subunit and acorresponding relationship generating subunit. The correspondingrelationship establishing unit is used in the case the serviceidentifier is the device identifier.

The device identifier obtaining subunit obtains a device identifier ofthe network device itself and a device identifier of the another networkdevice.

The corresponding relationship generating subunit associates the deviceidentifier of the network device with the device identifier of theanother network device, and establishes a corresponding relationshipbetween the network device and the another network device.

Preferably, the corresponding relationship between the network deviceand the another network device may be represented by a binary set thatincludes two elements, namely the device identifier of the networkdevice and the device identifier of the another network device.

Optionally, as shown in FIG. 7, the corresponding relationshipestablishing unit includes a device identifier obtaining subunit, alogic domain identifier obtaining subunit, a logic domain confirmingsubunit, and a corresponding relationship generating subunit. Thecorresponding relationship establishing unit is used in the case theservice identifier is the device identifier and the logic domainidentifier.

The device identifier obtaining subunit obtains a device identifier ofthe network device itself and a device identifier of the another networkdevice.

The logic domain identifier obtaining subunit obtains a logic domainidentifier of the network device itself and a logic domain identifier ofthe another network device.

The logic domain confirming subunit confirms whether the network deviceand the another network device are located in the same logic domainaccording to the logic domain identifier of the network device itselfand the logic domain identifier of the another network device.

The corresponding relationship generating subunit associates the deviceidentifier of the network device with the device identifier of theanother network device, and establishes a corresponding relationshipbetween the network device and the another network device, after it isdetermined that the network device and the another network device arelocated in the same logic domain.

Preferably, the corresponding relationship between the network deviceand the another network device may be represented by a ternary set thatincludes three elements, namely the same logic domain identifier, thedevice identifier of the network device and the device identifier of theanother network device; alternatively, the corresponding relationshipbetween the network device and the another network device may berepresented by a binary set that includes two elements, namely thedevice identifier of the network device and the device identifier of theanother network device.

As comprehensible to persons ordinarily skilled in the art, the entireor partial steps of the aforementioned method embodiments can berealized by relevant hardware(s) instructed by a program, and theprogram can be stored in a computer-readable storage medium and carryout the steps of the aforementioned method embodiments when executed.The storage medium includes such various media capable of storingprogram codes as an ROM, an RAM, a magnetic disc or an optical disc, andso on.

The above is merely directed to preferred specific embodiments of thepresent invention, but the protection scope of the present invention isnot limited thereto, as any modifications or substitutions easilyconceivable to persons skilled in the art within the technical scope asherein disclosed shall all be covered by the protection scope of thepresent invention.

What is claimed is:
 1. A method for distributing multi-protocol labelswitching, MPLS, labels, comprising: receiving, by a first provideredge, PE, device, a border gateway protocol, BGP, protocol messagetransmitted from a second PE device, wherein the BGP protocol messagecarries a service identifier of the second PE device, wherein theservice identifier of the second PE device comprises a logic domainidentifier of the second PE device and a device identifier of the secondPE device; determining, by the first PE device, whether the first PEdevice and the second PE device are located in a same logic domainaccording to a logic domain identifier of the first PE device and thelogic domain identifier of the second PE device; establishing, accordingto a device identifier of the first PE device and the device identifierof the second PE device, by the first PE device, a correspondingrelationship between the first PE device and the second PE device inresponse to determining that the first PE device and the second PEdevice are located in the same logic domain; and distributing, by thefirst PE device, an MPLS label for the corresponding relationship. 2.The method according to claim 1, wherein the corresponding relationshipbetween the first PE device and the second PE device is represented byusing a binary set comprising the device identifier of the first PEdevice and the device identifier of the second PE device.
 3. The methodaccording to claim 1, wherein the corresponding relationship between thefirst PE device and the second PE device is represented by using aternary set comprising the same logic domain identifier, the deviceidentifier of the first PE device and the device identifier of thesecond PE device.
 4. The method according to claim 1, wherein the logicdomain identifier comprises a route target (RT), a route distinguisher(RD), a virtual private LAN service identifier (VPLS ID), an attachmentidentifier (AI) and/or an attachment circuit identifier (ACI).
 5. Themethod according to claim 1, wherein the method further comprises:transmitting, by the first PE device, the MPLS label to the second PEdevice, wherein the MPLS label is used for encapsulating the message bythe second PE device, and the encapsulated message is transmitted to thefirst PE device.
 6. A network device, comprising: a border gatewayprotocol, BGP, protocol message receiving unit, a correspondingrelationship establishing unit, and an MPLS label distributing unit;wherein the BGP protocol message receiving unit receives a BGP protocolmessage transmitted from another network device, the BGP protocolmessage carrying a service identifier of the another network device; thecorresponding relationship establishing unit establishes a correspondingrelationship between the network device and the another network deviceaccording to a service identifier of the network device and the serviceidentifier of the another network device; and the label distributingunit distributes an MPLS label for the corresponding relationship;wherein the corresponding relationship establishing unit comprises adevice identifier obtaining subunit, a logic domain identifier obtainingsubunit, a logic domain confirming subunit, and a correspondingrelationship generating subunit; wherein the device identifier obtainingsubunit obtains a device identifier of the network device itself and adevice identifier of the another network device; the logic domainidentifier obtaining subunit obtains a logic domain identifier of thenetwork device itself and a logic domain identifier of the anothernetwork device; the logic domain confirming subunit confirms whether thenetwork device and the another network device are located in a samelogic domain according to the logic domain identifier of the networkdevice itself and the logic domain identifier of the another networkdevice; and the corresponding relationship generating subunit associatesthe device identifier of the network device with the device identifierof the another network device, and establishes a correspondingrelationship between the network device and the another network device,after it is determined that the network device and the another networkdevice are located in the same logic domain.
 7. The network deviceaccording to claim 6, further comprising an MPLS label transmitting unitthat transmits the MPLS label distributed by the network device to theanother network device.
 8. The network device according to claim 6,wherein the corresponding relationship generating subunit represents thecorresponding relationship between the network device and the anothernetwork device with a ternary set that comprises the same logic domainidentifier, the device identifier of the network device and the deviceidentifier of the another network device.
 9. The network deviceaccording to claim 6, wherein the corresponding relationship generatingsubunit represents the corresponding relationship between the networkdevice and the another network device with a binary set that comprisesthe device identifier of the network device and the device identifier ofthe another network device.
 10. A computer program product, comprisingcomputer executable instructions stored on a non-transitory computerreadable medium, wherein when the instructions are executed by aprocessor of a first provider edge, PE, device, causes the processor to:receive a border gateway protocol, BGP, protocol message transmittedfrom a second PE device, wherein the BGP protocol message carries aservice identifier of the second PE device, wherein the serviceidentifier of the second PE device comprises a logic domain identifierof the second PE device and a device identifier of the second PE device;determine whether the first PE device and the second PE device arelocated in a same logic domain according to a logic domain identifier ofthe first PE device and the logic domain identifier of the second PEdevice; establish, according to a device identifier of the first PEdevice and the device identifier of the second PE device, acorresponding relationship between the first PE device and the second PEdevice in response to determining that the first PE device and thesecond PE device are located in the same logic domain; and distribute anMPLS label for the corresponding relationship.
 11. The product accordingto claim 10, wherein the corresponding relationship between the first PEdevice and the second PE device is represented by using a binary setcomprising the device identifier of the first PE device and the deviceidentifier of the second PE device.
 12. The product according to claim10, wherein the corresponding relationship between the first PE deviceand the second PE device is represented by using a ternary setcomprising the same logic domain identifier, the device identifier ofthe first PE device and the device identifier of the second PE device.13. The product according to claim 10, wherein the instructions furthercause the processor to: transmit the MPLS label to the second PE device,wherein the MPLS label is used for encapsulating the message by thesecond PE device, and the encapsulated message is transmitted to thefirst PE device.